<template>
  <div class="card">
    <h3>拖拽上传</h3>
    <section class="upload_box" id="upload6" ref="uploadRef">
      <input
        ref="inputRef"
        type="file"
        class="upload_inp"
        @change="changeFile"
      />
      <div class="upload_drag">
        <i class="icon"></i>
        <span class="text">
          将文件拖到此处，或
          <a href="javascript:;" class="upload_submit" @click="selectFile">
            点击上传
          </a>
        </span>
      </div>
      <div class="upload_mark" v-if="loading">正在上传中，请稍等...</div>
    </section>
  </div>
</template>

<script setup>
import { useUploadSingle } from "@/hook";
// 封装上传钩子
let { inputRef, uploadRef, loading, selectFile, changeFile } = useUploadSingle({
  immediate: true,
  isdarg: true,
  multiple: true,
});
</script>

<style>
.upload_mark {
  display: block !important;
}
</style>
